<template>
  <div class="detail-base">
    <!--返回按钮-->
    <t-button theme="primary" style='margin-bottom: 10px;' @click='$router.back()'>
      <template #icon><ArrowLeftIcon /></template>
      返回
    </t-button>
    <t-card title="线下领养人基本信息" :bordered="false">
      <div class="info-block">
        <div v-for="(item, index) in baseInfoData" :key="index" class="info-item">
          <h1>{{ item.name }}</h1>
          <span
            :class="{
              ['inProgress']: item.type && item.type.value === 'inProgress',
              ['pdf']: item.type && item.type.value === 'pdf',
            }"
          >
            <i v-if="item.type && item.type.key === 'contractStatus'" />
            {{ item.value }}
          </span>
        </div>
      </div>
    </t-card>

    <t-card title="申请进度" class="container-base-margin-top" :bordered="false">
      <t-steps class="detail-base-info-steps" layout="vertical" theme="dot" :current="2">
        <t-step-item title="申请线上云领养" content="2024-1-20 15:36:17" />
        <t-step-item title="进行审核 - 通过" content="审核通过, 宋强为人友好, 热爱小动物" />
        <t-step-item title="分配宠物 - 进行中" content="" />
      </t-steps>
    </t-card>
  </div>
</template>
<script>
import { prefix } from '@/config/global';
import model from '@/service/service-detail-base';
import { ArrowLeftIcon } from 'tdesign-icons-vue'
export default {
  name: 'DetailBase',
  components:{
    ArrowLeftIcon
  },
  created () {
  },
  data() {
    return {
      prefix,
      baseInfoData: [
        {
          "name": "申请人名称",
          "value": "罗勇强"
        },{
          "name": "现居住地址",
          "value": "广东省广州市天河区天河壹品A栋15号"
        },
        {
          "name": "申请状态",
          "value": "审核通过",
          "type": {
            "key": "contractStatus",
            "value": "inProgress"
          }
        },
        {
          "name": "申请编号",
          "value": "BH00010"
        },
        {
          "name": "申请类型",
          "value": "线上云领养"
        },
        {
          "name": "个人描述",
          "value": "我本人性格友善, 热爱动物, 希望能有一个动物陪伴"
        },
        {
          "name": "申请日期",
          "value": "2024-1-20"
        },
        {
          "name": "详细信息",
          "value": "宋强.pdf",
          "type": {
            "key": "contractAnnex",
            "value": "pdf"
          }
        },
      ],
    };
  },
  methods: {},
};
</script>
<style lang="less" scoped>
@import '@/style/variables.less';

.detail-base {
  /deep/ .t-card {
    padding: 8px;
  }

  /deep/ .t-card__title {
    font-size: 20px;
    font-weight: 500;
  }

  &-info-steps {
    padding-top: 12px;
  }
}

.info-block {
  column-count: 2;

  .info-item {
    padding: 12px 0;
    display: flex;
    color: var(--td-text-color-primary);

    h1 {
      width: 200px;
      font: var(--td-font-body-medium);
      color: var(--td-text-color-secondary);
      font-weight: normal;
      text-align: left;

      @media (max-width: @screen-sm-max) {
        width: 100px;
      }

      @media (min-width: @screen-md-min) and (max-width: @screen-md-max) {
        width: 120px;
      }
    }

    span {
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      margin-left: 24px;
    }

    i {
      display: inline-block;
      width: 8px;
      height: 8px;
      border-radius: var(--td-radius-circle);
      background: var(--td-success-color-5);
    }

    .inProgress {
      color: var(--td-success-color-5);
    }

    .pdf {
      color: var(--td-brand-color);

      &:hover {
        cursor: pointer;
      }
    }
  }
}

.dialog-info-block {
  .info-item {
    padding: 12px 0;
    display: flex;

    h1 {
      width: 84px;
      font-family: PingFangSC-Regular;
      font-size: 14px;
      color: var(--td-text-color-secondary);
      text-align: left;
      line-height: 22px;
    }

    span {
      margin-left: 24px;
    }

    i {
      display: inline-block;
      width: 8px;
      height: 8px;
      border-radius: var(--td-radius-circle);
      background: var(--td-success-color-5);
    }

    .green {
      color: var(--td-success-color-5);
    }

    .blue {
      color: var(--td-brand-color);
    }
  }
}

</style>
